﻿using CPPEI.Console;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestTCPServer
{
    class Program
    {
        static AppTCPServer _server;

        static void Main(string[] args)
        {
            _server = new AppTCPServer(new RequestHandlerFactory());

            _server.Start("127.0.0.1", 4788);
            new App().Run(args);
            _server.Stop();
        }
    }

    class App : XApplication
    {
        public App()
            : base("CPPEI", "Test", "TestTCPServer", "TCPServer测试程序")
        {
        }

        protected override bool OnXStartup(StartupParamCollection startupParams)
        {
            return true;
        }
    }

    class AppTCPServer : CPPEI.Net.TCP.TCPServer
    {
        public AppTCPServer(CPPEI.Net.TCP.IRequestHandlerFactory factory)
            : base(factory)
        {
        }

        protected override void OnClientConnected(CPPEI.Net.NetClientProxy client)
        {
        }

        protected override void OnClientDisconnected(CPPEI.Net.NetClientProxy client)
        {
        }
    }
}
